package com.sammy.appmonitor.contentprovider;

import org.json.JSONObject;

import com.sammy.appmonitor.main.MainActivity;

import com.sammy.utils.MyLog;

public class RecordAppHistory {
	
	public static final String TAG = "RecordAppHistory.";
	
	private String appName;
	private String actionType;
		
	public RecordAppHistory(){
		
	}
	
	public RecordAppHistory(String strContent){		
		try{
			JSONObject jsonObjContent = new JSONObject(strContent);
			appName = (String)jsonObjContent.get("appName");
			actionType = (String)jsonObjContent.get("actionType");
		}catch(Exception e){
			MyLog.e(MainActivity.PROCESS_TAG, TAG+"RecordAppHistory exception: " + e.getMessage());
		}
	}
	
	public String getAppName() {
		return appName;
	}
	public void setAppName(String appName) {
		this.appName = appName;
	}
	public String getActionType() {
		return actionType;
	}
	public void setActionType(String actionType) {
		this.actionType = actionType;
	}
	
	public String getContent(){
		JSONObject content = new JSONObject();
		try{		
			content.put("appName",appName);
			content.put("actionType",actionType);
		}catch(Exception e){
			MyLog.e(MainActivity.PROCESS_TAG, TAG+"getContent exception: " + e.getMessage());
		}
		return content.toString();
	}
}
